package com.fable.base;

import java.util.List;

/***
 * 分页bean
 */
public class PaginationResult<X> {

	private List<X> resultList;

	private int currentPage;

	private int totalPage;
	private int pageSize;

	private int totalCount ; // 总的数目

	public List<X> getResultList() {
		return resultList;
	}

	public void setResultList(List<X> resultList) {
		this.resultList = resultList;
	}

    public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public int getTotalPage() {
		int totalPage = this.getTotalCount() % this.getPageSize() == 0 ? this.getTotalCount() / this.getPageSize() : this.getTotalCount() / this.getPageSize() + 1;

		return totalPage;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
}
